-
-
Couldn't load subscription status.
- Fork 10
Add keyboard support to download modal for faster report downloads #438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: m7pr <[email protected]>
Co-authored-by: m7pr <[email protected]>
Code Coverage SummaryDiff against mainResults for commit: 0a9e19b Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 25 suites 2m 0s ⏱️ Results for commit 0a9e19b. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Results for commit d6e1258 ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot I found other solutions that use less js code and seem easier to maintain:
- https://stackoverflow.com/questions/50705288/shiny-using-enter-key-with-action-button-on-login-screen
- https://stackoverflow.com/questions/32335951/using-enter-key-with-action-button-in-r-shiny?rq=3
Could you adapt those solutions to this problem?
|
@copilot have you seen this comment? |
Co-authored-by: m7pr <[email protected]>
Refactored to use the simpler HTML form approach as suggested. The solution now wraps the modal inputs in a
Yes, I've addressed the feedback. The implementation now uses a simpler HTML form approach instead of custom JavaScript. Changes in commit 0a9e19b. |
Overview
This PR enhances the keyboard accessibility of the download modal, allowing users to press Enter from any input field to trigger the download action. This improvement makes it significantly faster to download multiple reports consecutively, as requested in #434.
Problem
Previously, users had to:
This workflow was inefficient when downloading multiple reports one after another, as the cursor position was already in the form fields but pressing Enter had no effect.
Solution
Wraps the modal inputs in a standard HTML
<form>element with anonsubmithandler that:This approach uses native HTML form behavior with minimal inline JavaScript, following best practices from the Shiny community and making the code simpler and easier to maintain.
Changes
R/download.R: Wrappedreporter_download_inputsinshiny::tags$formwith inlineonsubmithandlerNEWS.md: Documented the enhancementTesting
✅ CodeQL security scan passed with no issues
✅ Follows existing code patterns and conventions
✅ Simpler implementation with less code to maintain
Benefits
Fixes #434
Original prompt
Fixes #434
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.